package Q4;

import java.io.Serializable;

/*
其中 UserMessage 类的特征有：类型(字符串类型) 和 用户对象(User 类型)。
如：
UserMessage tum = new UserMessage("check", new User("admin", "123456"));
 */

public class UserMassage implements Serializable {
    private static final long serialVersionUID = -4067055762445000278L;
    String content;
    User client;
    String type = "fail";

    public UserMassage() {
    }

    public UserMassage(String content, User client) {
        this.content = content;
        this.client = client;
    }


    public String getContent() {
        return content;
    }

    public User getClient() {
        return client;
    }

    public String getType() {
        return type;
    }


    public void setContent(String content) {
        this.content = content;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "用户"+ client.getName() +" 说：" + content;
    }
}
